<?php
/**
 * @author william
 * @since 2017-01-09
 */
namespace V6;
class C_Weishop
{
    public $isActive = true;
    public $remark = '获取微商城配置';

    public function get(array $req, array $post, &$result)
    {
        if (!isset($req['k']) || !isset($req['t'])) {
            return 'data error';
        }
        if (!isset($req['enterpriseId'])) {
            return 'require enterprise id';
        }
        $enterprise_id = $req['enterpriseId'];

        $setting = \Biz\Enterprise\Weishop::getByEnterpriseId($enterprise_id);
        if ($setting->getId()) {
            $result['user_open'] = $setting->getUserOpen();
            $result['customer_open'] = $setting->getCustomerOpen();
            $result['company'] = $setting->getCompany();
        }
    }
}